function my_gamma_correction(file_name)

%将照片转换为灰度图像
rgb_img=imread(file_name);
gray_img=rgb2gray(rgb_img);

%计算出像素最大值 像素归一化 
originalMaxValue = double(max(max(gray_img)));
a=double(gray_img)/originalMaxValue;

%Gamma修正
b0=a.^0.5;
b1=uint8(b0*originalMaxValue);
c0=a.^2;
c1=uint8(c0*originalMaxValue);


%显示导出结果
subplot(1,3,1);
imshow(gray_img),title("original");
subplot(1,3,2);
imshow(b1),title("Gamma:0.5");
subplot(1,3,3);
imshow(c1),title("Gamma:2");

%保存导出
imwrite(b1,"Gamma0.5.tif");
imwrite(c1,"Gamma2.tif");

clear;
end